package com.business.action.record;

import com.business.bean.record.DormitoryRecord;
import com.business.bean.system.UserBean;
import net.sf.rose.jdbc.PageBean;
import net.sf.rose.jdbc.dao.BeanDAO;
import net.sf.rose.jdbc.query.BeanSQL;
import net.sf.rose.jdbc.service.Service;
import net.sf.rose.web.util.WebUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by jiangwenfeng on 2019/10/19.
 */
@Controller
@RequestMapping("/record/domitory")
public class DomitoryRecordAction {

     /**
       * @description 查询住宿记录
       * @author  jiangwenfeng
       * @date 创建时间：2019/10/19 18:12
      */
     @ResponseBody
     @RequestMapping("/getDormitoryRecordList.do")
     public PageBean getDormitoryRecordList(HttpServletRequest request, Service service) {
         PageBean page = WebUtils.getPageBean(request);
         Map<String, Object> map = WebUtils.getRequestData(request);
         BeanDAO dao = new BeanDAO(service);
         BeanSQL query = dao.getQuerySQL();
         query.setPage(page);
         query.setEntityClass(DormitoryRecord.class);
         query.setTableName("REC_DORMITORY_VIEW");
         query.createSql(map);
         dao.list();
         return page;
     }

}
